<?php
/**
 * Created by IntelliJ IDEA.
 * User: XD
 * Date: 2017/8/22
 * Time: 10:55
 */
 class MyDestructableClass{

     var $name;
     function __construct()
     {
         print "构造函数\n";
         $this->name = "MyDestructableClass";
     }

     function getName(){
         echo $this->name.PHP_EOL;
     }

     function  __destruct()
     {
         // TODO: Implement __destruct() method.
         print "销毁 " . $this->name . "\n";
     }
 }

 $obj  = new MyDestructableClass();
 $obj ->getName();


?>